//package com.parking.mgr.useraccount.controller;
//
//import com.parking.mgr.common.annotion.BusinessLog;
//import com.parking.mgr.common.annotion.LoginAuth;
//import com.parking.mgr.common.annotion.PermissionUrl;
//import com.parking.mgr.common.enums.LogAnnotionOpTypeEnum;
//import com.parking.mgr.common.pojo.response.Result;
//import com.parking.mgr.useraccount.model.param.BasicMenuParam;
//import com.parking.mgr.useraccount.service.BasicMenuService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import lombok.extern.log4j.Log4j2;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import java.util.Collection;
//
///**
// * @ClassName BasicMenuController
// * @Description 功能菜单
// * @Auther: zhijianpu
// * @Date: 2023/5/19
// */
//@Log4j2
//@Api(value = "功能菜单", tags = {"功能菜单"})
//@RequestMapping("/api/basic/menu")
//@RestController
//public class BasicMenuController {
//
//    @Resource
//    private BasicMenuService basicMenuService;
//
//    /**
//     * 系统菜单列表（树）
//     *
//     * @param basicMenuParam
//     * @return
//     */
//    @ApiOperation(value = "系统菜单列表(树)", notes = "系统菜单列表(树)", httpMethod = "GET")
//    @GetMapping("/treeall")
//    @BusinessLog(title = "系统菜单列表(树)", opType = LogAnnotionOpTypeEnum.QUERY)
//    @PermissionUrl
//    public Result<?> list(BasicMenuParam basicMenuParam, HttpServletRequest request) {
//        return Result.success(basicMenuService.list(basicMenuParam, request));
//    }
//
//    @ApiOperation(value = "系统菜单列表(树)启用状态", notes = "系统菜单列表(树)启用状态", httpMethod = "GET")
//    @GetMapping("/listenable")
//    @BusinessLog(title = "系统菜单列表(树)启用状态", opType = LogAnnotionOpTypeEnum.QUERY)
//    @PermissionUrl
//    public Result<?> treeEnable(BasicMenuParam basicMenuParam, HttpServletRequest request) {
//        return Result.success(basicMenuService.listEnable(basicMenuParam, request));
//    }
//
//    @ApiOperation(value = "系统菜单列表（不区分状态）", notes = "系统菜单列表（不区分状态）", httpMethod = "GET")
//    @GetMapping("/treeenable")
//    @BusinessLog(title = "获取系统菜单列表", opType = LogAnnotionOpTypeEnum.QUERY)
//    @PermissionUrl
//    public Result<?> listAll(HttpServletRequest request) {
//        log.info("获取系统菜单列表");
//        return Result.success(basicMenuService.listAll(request));
//    }
//
//    @ApiOperation(value = "系统功能菜单列表(树)", notes = "系统功能菜单列表(树)", httpMethod = "GET")
//    @GetMapping("/accemenue")
//    @BusinessLog(title = "系统功能菜单列表", opType = LogAnnotionOpTypeEnum.TREE)
//    public Result<?> acceMenuE(HttpServletRequest request) {
//        log.info("获取系统功能菜单列表");
//        return Result.success(basicMenuService.treeMenuE(request));
//    }
//
//    /**
//     * 添加系统菜单
//     *
//     * @param basicMenuParam
//     * @return
//     */
//    @PostMapping("/add")
//    @ApiOperation(value = "添加功能菜单", notes = "添加功能菜单", httpMethod = "POST")
//    @BusinessLog(title = "系统菜单_增加", opType = LogAnnotionOpTypeEnum.ADD)
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> add(@RequestBody @Validated(BasicMenuParam.add.class) BasicMenuParam basicMenuParam,
//                         HttpServletRequest request) {
//        basicMenuService.add(basicMenuParam, request);
//        return Result.success();
//    }
//
//    /**
//     * 删除系统菜单
//     *
//     * @param ids
//     * @return
//     */
//    @PostMapping("/delete")
//    @ApiOperation(value = "删除功能菜单", notes = "删除功能菜单", httpMethod = "POST")
//    @BusinessLog(title = "系统菜单_删除", opType = LogAnnotionOpTypeEnum.DELETE)
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> delete(@ApiParam(name = "id", value = "id", required = true)
//                            @RequestParam(name = "id", required = true)
//                            Collection<String> ids, HttpServletRequest request) {
//        basicMenuService.delete(ids, request);
//        return Result.success();
//    }
//
//    /**
//     * 编辑菜单
//     *
//     * @param basicMenuParam
//     * @return
//     */
//    @PostMapping("/edit")
//    @ApiOperation(value = "编辑功能菜单", notes = "编辑功能菜单", httpMethod = "POST")
//    @BusinessLog(title = "功能菜单_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> edit(@RequestBody @Validated(BasicMenuParam.edit.class) BasicMenuParam basicMenuParam, HttpServletRequest request) {
//        basicMenuService.edit(basicMenuParam, request);
//        return Result.success();
//    }
//
//    @PostMapping("/move")
//    @ApiOperation(value = "移动功能菜单", notes = "移动功能菜单", httpMethod = "POST")
//    @LoginAuth
//    @PermissionUrl
//    public Result<?> move(
//            @ApiParam(name = "currentId", value = "当前功能菜单ID", required = true)
//            @RequestParam(name = "currentId")
//            String currentId,
//            @ApiParam(name = "newId", value = "移动目标功能菜单ID", required = true)
//            @RequestParam(name = "newId")
//            String newId) {
//        basicMenuService.move(currentId, newId);
//        return Result.success();
//    }
//
//    @ApiOperation(value = "未登录可访问菜单树(缓存)", notes = "未登录可访问菜单树(缓存)", httpMethod = "GET")
//    @GetMapping("/cache/accemenue/tree")
//    @BusinessLog(title = "未登录可访问菜单树(缓存)", opType = LogAnnotionOpTypeEnum.TREE)
//    public Result<?> acceMenuETreeByCache(HttpServletRequest request) {
//        log.info("获取系统功能菜单列表");
//        return Result.success(basicMenuService.acceMenuETreeByCache(request));
//    }
//
//    @ApiOperation(value = "未登录可访问菜单列表(缓存)", notes = "未登录可访问菜单列表(缓存)", httpMethod = "GET")
//    @GetMapping("/cache/accemenue/list")
//    @BusinessLog(title = "未登录可访问菜单列表(缓存)", opType = LogAnnotionOpTypeEnum.TREE)
//    public Result<?> acceMenuEListByCache(HttpServletRequest request) {
//        log.info("获取系统功能菜单列表");
//        return Result.success(basicMenuService.acceMenuEListByCache(request));
//    }
//
//    @ApiOperation(value = "未登录可访问功能列表(缓存)", notes = "未登录可访问功能列表(缓存)", httpMethod = "GET")
//    @GetMapping("/cache/accemenuf/list")
//    @BusinessLog(title = "未登录可访问功能列表(缓存)", opType = LogAnnotionOpTypeEnum.TREE)
//    public Result<?> acceMenuFListByCache(HttpServletRequest request) {
//        log.info("获取系统功能菜单列表");
//        return Result.success(basicMenuService.acceMenuFListByCache(request));
//    }
//
//}
